<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="bolao" />
    <g:set var="entityName" value="${message(code: 'user.label', default: 'User')}" />
    <title><g:message code="default.show.label" args="[entityName]" /></title>
  </head>
  <body>
    <div class="body">
      <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
      </g:if>
      <div class="dialog">
        <fieldset>
          <legend><g:message code="default.show.label" args="[entityName]" /></legend>
          <table>
            <tbody>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.username.label" default="Username"/>:</td>
                <td valign="top" class="value">${user?.username?.encodeAsHTML()}</td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.firstname.label" default="Firstname"/>:</td>
              <td valign="top" class="value">${user?.firstname?.encodeAsHTML()}</td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.surname.label" default ="Surname"/>:</td>
              <td valign="top" class="value">${user?.surname?.encodeAsHTML()}</td>
              </tr>
              <g:ifAnyGranted role="ROLE_ADMIN">
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.active.label" default="Active"/>:</td>
              <td valign="top" class="value"><g:formatBoolean boolean="${user?.active}" /></td>
              </tr>
              </g:ifAnyGranted>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.contactNumber.label" default="Contact Number"/>:</td>
              <td valign="top" class="value">${user?.contactNumber?.encodeAsHTML()}</td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.email.label" default="Email"/>:</td>
              <td valign="top" class="value">${user?.email?.encodeAsHTML()}</td>
              </tr>
              <tr class="prop">
                <td valign="top" class="name"><g:message code="user.roles.label" default="Roles"/>:</td>
              <td valign="top" class="value">
                <ul>
                  <g:each in="${user?.roles}" var='role'>
                    <li>${role?.description}</li>
                  </g:each>
                </ul>
              </td>
            </tr>
            </tbody>
          </table>
        </fieldset>
      </div>
      <div class="buttons">
        <g:form>
          <input type="hidden" name="id" value="${user?.id}" />
          <g:ifAnyGranted role="ROLE_ADMIN">
            <span class="button"><g:actionSubmit class="edit" value="${message(code:'global.edit')}" action="edit" /></span>
            <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
          </g:ifAnyGranted>
        </g:form>
      </div>
    </div>
  </body>
</html>